<?php
// Carico dati della segnalazione
$rid = JRequest::getVar( 'rid');
if($rid) {
	$query = "SELECT * FROM #__fap_report_allarm WHERE rid='$rid'";
	$database->setQuery( $query );
	$data = $database->loadAssoc();
	if($data) { 
	?>
						<fieldset>
							<input type="hidden" value="<?php echo $data["id"] ?>" name="id"/>
							<input type="hidden" value="1" name="confirmed"/>
							<input type="hidden" name="name" id="name" value="<?php echo isset($data["name"]) ? $data["name"] : "" ?>"/>
							<input type="hidden" name="surname" id="surname" value="<?php echo isset($data["surname"]) ? $data["surname"] : "" ?>"/>
							<input type="hidden" name="email" id="email" value="<?php echo isset($data["email"]) ? $data["email"] : "" ?>"/>
							<input type="hidden" name="phone" id="phone" value="<?php echo isset($data["phone"]) ? $data["phone"] : "" ?>"/>
							<input type="hidden" name="school" id="school" value="<?php echo isset($data["school"]) ? $data["school"] : "" ?>"/>
							<input type="hidden" name="classroom" id="classroom" value="<?php echo isset($data["classroom"]) ? $data["classroom"] : "" ?>"/>
							<input type="hidden" name="report_address" id="report_address" value="<?php echo isset($data["report_address"]) ? $data["report_address"] : "" ?>"/>
							<input type="hidden" name="report_number" id="report_number" value="<?php echo isset($data["report_number"]) ? $data["report_number"] : "" ?>"/>
							<input type="hidden" name="report_zip" id="report_zip" value="<?php echo isset($data["report_zip"]) ? $data["report_zip"] : "" ?>"/>
							<input type="hidden" name="report_type" id="report_type" value="<?php echo isset($data["report_type"]) ? $data["report_type"] : "" ?>"/>
							<input type="hidden" name="report" id="report" value="<?php echo isset($data["report"]) ? $data["report"] : "" ?>"/>
							<input type="hidden" name="report_photo" id="report_photo" value="<?php echo isset($data["report_photo"]) ? $data["report_photo"] : "" ?>"/>
							
							<p>
								<button type="submit" class="confirm">conferma segnalazione</button>
							</p>
														
						</fieldset>
	<?php
	} else {
		echo JText::_('ALERTNOTAUTH');
	}
	
} else {
	echo JText::_('ALERTNOTAUTH');
}
?>